﻿@model IEnumerable<tutors_clus.Models.news>

@{
    ViewBag.Title = "Kết quả tìm kiếm";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@{Html.RenderAction("Search_News", "Home");}
<div class="clear"></div>

@if (ViewBag.count <= 0)
{
    <div>Không có kết quả tìm kiếm nào cho: <b>@ViewBag.search</b></div>
}
else
{
    <div>Có "@ViewBag.count" kết quả cho: <b>@ViewBag.search</b></div>
    <div class ="content">
           
               @foreach (var item in Model)
               {
                   <div class="news">
                       <div class="img_news">@if (item.image_news == "" || item.image_news == null)                                                 
	                    {
                              <img src="../Content/images/noimage.gif" alt="Alternate Text" style="width:100px;height:100px"/>                                  
		                    
	                    }
                        else
                        {
                             <img src="@item.image_news" alt="Alternate Text" style="width:100px;height:100px"/>   
                             
                        }
                       </div>                                          
                       <div class="title_news">@Html.ActionLink(@item.title_new, "Detail_News", new { id = item.id_new}) <i>(@item.create_date_new)</i></div>
                       <div class= "detail_news"> @MvcHtmlString.Create(item.detail_new.Substring(0,200))...</div>
                       <div class="readmore">@Html.ActionLink("xem tiếp", "Detail_News", new { id = item.id_new})</div>                      
                       <div class="line"></div>
                   </div>
                   
               }
    @*<div>
    Trang @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) trong tổng số @Model.PageCount trang

    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "News", new { page = 1, order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink("< Trước", "News", new { page = Model.PageNumber - 1,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Trước
    }
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Sau >", "News", new { page = Model.PageNumber + 1,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "News", new { page = Model.PageCount,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:Sau >
        @Html.Raw(" ")
        @:>>
    }
</div>*@
          
        </div>
}
